home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mrcry204.zip / DERIV.EKA < prev    next >
Text File  |  1991-03-04  |  270b  |  12 lines

  1. ; Demo of symbolic derivatives.
  2. ; x is deliberately left undefined, so Mercury will not be able to simplify
  3. ; to a real value.
  4. f(x) := EXP(x SIN(x))
  5. a = deriv(f(x),x)
  6.  
  7. ; numerical derivatives
  8. b = deriv(f(y),y)
  9. c = (f(y + eps) - f(y)) / eps
  10. eps = 1e-10
  11. y = 1
  12.